void setup()
{
  appRef = this;
  
  size(screenW, screenH, OPENGL);
  background(0);
  
  thePlanets = new game();
}

void draw()
{
  if(thePlanets.isRunning())
  {
    switch(thePlanets.gameState())
    {
    case GS_NULL:
      thePlanets.gameState(GS_MENU);
      break;
    case GS_MENU:
      thePlanets.gameState(GS_INIT_GAME);
      break;
    case GS_INIT_GAME:
      initGame();
      thePlanets.gameState(GS_RUN_GAME);
      break;
    case GS_RUN_GAME:
      gameFrame();
      break;
    }
  }
}
